home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / mem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  4.0 KB  |  138 lines

  1. /*  mem.h
  2.  
  3.     Memory manipulation functions
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1987, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.3  $ */
  15.  
  16. #if !defined(__MEM_H)
  17. #define __MEM_H
  18.  
  19. #ifndef ___STDDEF_H
  20. #include <_stddef.h>
  21. #endif
  22.  
  23. #if !defined(RC_INVOKED)
  24.  
  25. #if defined(__STDC__)
  26. #pragma warn -nak
  27. #endif
  28.  
  29. #endif  /* !RC_INVOKED */
  30.  
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. /* Intrinsic functions, defined outside of the namespace */
  37.  
  38. void _FAR * _RTLENTRY  _EXPFUNC16 __memchr__(const void _FAR * __s, int __c, _SIZE_T __n);
  39. int         _RTLENTRY  _EXPFUNC16 __memcmp__(const void _FAR * __s1, const void _FAR * __s2, _SIZE_T __n);
  40. void _FAR * _RTLENTRY  _EXPFUNC16 __memcpy__(void _FAR * __dest, const void _FAR * __src, _SIZE_T __n);
  41. void _FAR * _RTLENTRYF _EXPFUNC16 __memset__(void _FAR * __s, int __c, _SIZE_T __n);
  42.  
  43. #ifdef __cplusplus
  44. namespace std {
  45. #endif
  46.  
  47. void _FAR * _RTLENTRY  _EXPFUNC memccpy(void _FAR *__dest, const void _FAR *__src,
  48.                                         int __c, _SIZE_T __n);
  49. int         _RTLENTRY  _EXPFUNC memcmp(const void _FAR *__s1, const void _FAR *__s2,
  50.                                        _SIZE_T __n);
  51. void _FAR * _RTLENTRY  _EXPFUNC memcpy(void _FAR *__dest, const void _FAR *__src,
  52.                                        _SIZE_T __n);
  53. int         _RTLENTRY  _EXPFUNC memicmp(const void _FAR *__s1, const void _FAR *__s2,
  54.                                         _SIZE_T __n);
  55. void _FAR * _RTLENTRYF _EXPFUNC memmove(void _FAR *__dest, const void _FAR *__src,
  56.                                         _SIZE_T __n);
  57. void _FAR * _RTLENTRYF _EXPFUNC memset(void _FAR *__s, int __c, _SIZE_T __n);
  58.  
  59. void *          _RTLENTRY  _EXPFUNC _wmemset(void *__s, int __c, _SIZE_T __n);
  60. void *          _RTLENTRY  _EXPFUNC _wmemcpy(void *__dest, const void *__src, _SIZE_T __n);
  61.  
  62. #if defined(__cplusplus)
  63. extern "C++"
  64. {
  65.           void _FAR * _RTLENTRY _EXPFUNC32 memchr(void _FAR *__s, int __c, _SIZE_T __n);
  66.     const void _FAR * _RTLENTRY _EXPFUNC32 memchr(const void _FAR *__s, int __c, _SIZE_T __n);
  67.           void      * _RTLENTRY _EXPFUNC32 _wmemchr(void *__s, int __c, _SIZE_T __n);
  68.     const void      * _RTLENTRY _EXPFUNC32 _wmemchr(const void *__s, int __c, _SIZE_T __n);
  69. }
  70. #else
  71.           void _FAR * _RTLENTRY _EXPFUNC32 memchr(const void _FAR *__s, int __c, _SIZE_T __n);
  72.           void      * _RTLENTRY _EXPFUNC32 _wmemchr(const void *__s, int __c, _SIZE_T __n);
  73. #endif
  74.  
  75.  
  76.  
  77. #define movmem(src,dest,length) (void)memmove(dest,src,length)
  78. #define setmem(dest,length,value) (void)memset(dest,value,length)
  79.  
  80. #if !defined(__STDC__) /* NON_ANSI  */
  81. #define _fmemccpy memccpy
  82. #define _fmemchr  memchr
  83. #define _fmemcmp  memcmp
  84. #define _fmemcpy  memcpy
  85. #define _fmemicmp memicmp
  86. #define _fmemmove memmove
  87. #define _fmemset  memset
  88. #define _fmovmem  movmem
  89. #define _fsetmem  setmem
  90. #endif /* __STDC__  */
  91.  
  92. #ifdef __cplusplus
  93. } // std
  94. } // extern "C"
  95. #endif
  96.  
  97. #if !defined(RC_INVOKED)
  98.  
  99. #if defined(__STDC__)
  100. #pragma warn .nak
  101. #endif
  102.  
  103. #endif  /* !RC_INVOKED */
  104.  
  105.  
  106. #endif  /* __MEM_H */
  107.  
  108. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__MEM_H_USING_LIST)
  109. #define __MEM_H_USING_LIST
  110.    using std::_wmemchr;
  111.    using std::_wmemcpy;
  112.    using std::_wmemset;
  113.    using std::memccpy;
  114.    using std::memicmp;
  115.    using std::memmove;
  116.  
  117. /*
  118.    Handle intrinsics specially.  If intrinsics are on, the compiler creates
  119.    a macro of the normal function mapping to the __ intrinsic version, ie:
  120.      #define strcpy __strcpy__
  121.    Thus, we can test the normal name as a macro to see if it's defined, and
  122.    only preform a using statement if it's not an intrinsic
  123. */
  124.  
  125. #  ifndef memchr
  126.      using std::memchr;
  127. #  endif // ifndef memchr
  128. #  ifndef memcmp
  129.      using std::memcmp;
  130. #  endif // ifndef memcmp
  131. #  ifndef memcpy
  132.      using std::memcpy;
  133. #  endif // ifndef memcpy
  134. #  ifndef memset
  135.      using std::memset;
  136. #  endif // ifndef memset
  137.  
  138. #endif /* __USING_CNAME__ */